home *** CD-ROM | disk | FTP | other *** search
- Path: strudel.rs.itd.umich.edu!davidm
- From: davidm@umich.edu (David Miller)
- Newsgroups: comp.lang.c
- Subject: Logical exclusive-or
- Date: 6 Feb 1996 04:36:10 GMT
- Organization: University of Michigan
- Message-ID: <4f6lrq$bcr@lastactionhero.rs.itd.umich.edu>
- NNTP-Posting-Host: strudel.rs.itd.umich.edu
- NNTP-Posting-User: 40746
- X-Newsreader: TIN [version 1.2 PL2]
-
- Is there a good reason why C doesn't have a logical exclusive-or
- operator? A look at the precedence hierarchy suggests an obvious
- symbol and precedence for such an operator:
-
- bitwise and &
- bitwise exclusive or ^
- bitwise inclusive or |
- logical and &&
- logical or ||
-
- The logical exclusive or would be represented by ^^ and have
- precedence higher than || but lower than && . If C requires machines
- to be able to implement bitwise XOR, then it would seem reasonable to
- require the logical operator also.
-
- --David M.
- "I command you to defy this order."
-